home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / tcinettool.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-10-16  |  2.6 KB  |  93 lines

  1. unit TCInetTool;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, oleauto, ActiveX, Graphics, Sysutils, AXCtrls, ComObj, InetTool_TLB, IMSIGX_TLB;
  7.  
  8. type
  9.   TTCInetTool = class(TAutoObject, ITCInetTool)
  10.   protected
  11.     function Get_Description: WideString; stdcall;
  12.     function GetToolInfo(var CommandNames, MenuCaptions, StatusPrompts,
  13.       Tooltips, Enabled, WantsUpdate: OleVariant): Integer; stdcall;
  14.     function GetPicture(var LargeImage, MonoImage: WordBool): IPictureDisp;
  15.       stdcall;
  16.     function Initialize(var Tool: IDispatch): WordBool; stdcall;
  17.     function Run(var Tool: IDispatch): WordBool; stdcall;
  18.     function UpdateToolStatus(var Tool: IDispatch; var Enabled,
  19.       Checked: WordBool): WordBool; stdcall;
  20.     {Declare ITCInetTool methods here}
  21.   end;
  22.  
  23. implementation
  24.  
  25. uses ComServ;
  26.  
  27. //'Number of tools in this server
  28. Const NUM_TOOLS = 1;
  29.  
  30. //'Toggle this to test loading buttons from .Bmp/.Res
  31. Const boolLoadFromBmp = False;
  32. Const boolDebug = False;
  33.  
  34. function TTCInetTool.Get_Description: WideString;
  35. begin
  36.     Get_Description := 'Internet connection tool';
  37. end;
  38.  
  39. function TTCInetTool.GetToolInfo(var CommandNames, MenuCaptions,
  40.   StatusPrompts, Tooltips, Enabled, WantsUpdate: OleVariant): Integer;
  41. begin
  42.     VarArrayRedim(CommandNames, NUM_TOOLS);
  43.     VarArrayRedim(MenuCaptions, NUM_TOOLS);
  44.     VarArrayRedim(StatusPrompts, NUM_TOOLS);
  45.     VarArrayRedim(ToolTips, NUM_TOOLS);
  46.     VarArrayRedim(Enabled, NUM_TOOLS);
  47.     VarArrayRedim(WantsUpdate, NUM_TOOLS);
  48.     CommandNames[0]:= 'SDK|Internet|Hyperlink';
  49.     MenuCaptions[0] := '&Hyperlink';
  50.     StatusPrompts[0] := 'Launch a browser on the World Wide Web';
  51.     ToolTips[0] := 'Hyperlink';
  52.     Enabled[0] := True;
  53.     WantsUpdate[0] := False;
  54.  
  55.     GetToolInfo := NUM_TOOLS;
  56.  
  57. end;
  58.  
  59. function TTCInetTool.GetPicture(var LargeImage,
  60.   MonoImage: WordBool): IPictureDisp;
  61. Var pTBmp: TBitMap;
  62.  
  63. begin
  64.  
  65.  
  66. end;
  67.  
  68. function TTCInetTool.Initialize(var Tool: IDispatch): WordBool;
  69. begin
  70.      Initialize := true;
  71. end;
  72.  
  73. function TTCInetTool.Run(var Tool: IDispatch): WordBool;
  74. begin
  75.  
  76. // Add your code here
  77.      MessageBox(0, 'Add your code here', 'TurboCAD SDK tool', IDOK );
  78.      Result := true
  79. end;
  80.  
  81. function TTCInetTool.UpdateToolStatus(var Tool: IDispatch; var Enabled,
  82.   Checked: WordBool): WordBool;
  83.   begin
  84.     Enabled := True;   //'Could do a test here to determine whether to disable the button/menu item
  85.     Checked := False;  // 'Could do a test here to determine whether to check the button/menu item
  86.     UpdateToolStatus := True;
  87. end;
  88.  
  89. initialization
  90.   TAutoObjectFactory.Create(ComServer, TTCInetTool, Class_TCInetTool,
  91.     ciMultiInstance, tmSingle);
  92. end.
  93.